<template>
 <div class="return" @click="lastStep">
    <img src="../assets/images/teacher/public/arrow-left-bold.svg" alt="返回">
    </div>
    <div class="container">
        <div class="step">
            <el-steps :active="active" finish-status="wait" align-center="true">
                <el-step title="基本信息" style=" font-family: Source Han;  color: #707070;" />
                <el-step title="内容设置" />
            </el-steps>
        </div>
        <div class="mainBox" style="margin-top: 2%;">
            <div class="title">课程简述</div>
            <textarea style="margin-top: 1.8%;" name="" class="introduction" id="" cols="30" rows="5"  v-model="data.introduction"></textarea>
        </div>
        <div class="mainBox">
            <div class="title">教程目标</div>
            <div class="subTitle">任务要求</div>
            <textarea name="" class="introduction" id="" cols="30" rows="5" v-model="data.preparation"></textarea>
        </div>
        <div class="mainBox" style="margin-top: 0.5%">
            <div class="subTitle" style="margin-top: 0%">考核标准</div>
            <textarea name="" class="introduction" id="" cols="30" rows="5" v-model="data.requirement"></textarea>
        </div>
        <div class="but">
            <el-button @click="lastStep">上一步</el-button>
            <div class="but2"><el-button @click="next">下一步</el-button>
                </div>
        </div>
</div>
</template>
<script setup>
import { onMounted, ref, reactive,  defineEmits,onBeforeUnmount} from 'vue';

const active = ref(1)

const emits =  defineEmits(['changePage', 'getAddCourseInfo'])

//课程简介
//课程需求
//考核标准
const data = ref({
    introduction: '',
    preparation: '',
    requirement: ''
})

//上一步，下一步
const lastStep = function(){
    emits('changePage', 0)
}
const next = function(){
    let courseInfo = data.value
    emits('getAddCourseInfo', courseInfo, 1)
    emits('changePage' ,2)
}

onMounted(() => {
    document.querySelector('.main').setAttribute('style', 'height: 65%')
})
onBeforeUnmount(() => {
    document.querySelector('.main').removeAttribute('style')
})
</script>
<style scoped>
.return {
    width: 30px;
    height: 30px;
    position: absolute;
    cursor: pointer;
    left: 1%;
    top: 1%;
}

.container {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
	box-shadow: 0px 3px 6px 0px 
		rgba(0, 0, 0, 0.16);
    padding: 4.2%;
    padding-top: 3%;
    display: flex;
    flex-direction: column;
}

.step {
    width: 97%;
}
.title{
    font-family: Source Han Sans CN;
	font-size: 1.5em;
	font-weight: normal;
	font-stretch: normal;
	letter-spacing: 0px;
    font-weight: 550;
	color: #707070;
}
.mainBox{
    width: 100%;
    height: 14%;
    margin-top: 1%;
}
.introduction{
    width: 94.8%;
    height: 80%;
    margin-top: 1%;
    background-color: #fafafa;
	border: solid 1px #707070;
    resize: none;
    font-family: Source Han Sans CN;
	font-size: 1.17em;
	font-weight: normal;
	font-stretch: normal;
	line-height: 1.5em;
	letter-spacing: 0px;
	color: #707070;
    padding: 2.2%;
    box-sizing: content-box;
    outline: none;
    padding-top: 1.5%;
}
.subTitle{
    font-family: Source Han Sans CN;
	font-size: 1.2em;
	font-weight: normal;
	font-stretch: normal;
	line-height: 31px;
	letter-spacing: 0px;
	color: #707070;
    margin-top: 1.6%;
}
.but {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}
.but2 button,
.but button {
    width: 120px;
	height: 40px;
	background-color: #939393;
	box-shadow: 0px 3px 6px 0px 
		rgba(0, 0, 0, 0.16);
	border-radius: 6px;
    font-family: Source Han Sans CN;
    font-size: 18px;
    font-weight: normal;
    font-stretch: normal;
    line-height: 31px;
    letter-spacing: 0px;
    color: #fafafa;
    margin-top: 26px;
}
.but2{
    margin-left:5%
}
.but2 button{
    background-color: #8493a6;
}
.but2 button:hover{
    background-color: #707070;
}
.but button:hover {
    background-color: #707070;
}
</style>